package com.certification.servlet.cap9;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;



//Servlet utilizado para criar listas para
//o entendimento das paginas sobre a tag c:forEach
public class ServletTagCForEach extends HttpServlet{
	
	
	private static final long serialVersionUID = 8144906436300135633L;

	@Override
	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws IOException, ServletException {
		this.doPost(request, response);
	}

	@Override
	public void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {

		
		String[] times = {"Velez","Santos","Boca Jr","Fluminense"};
		String[] times2 = {"Corinthians","Vasco","Universidade Catolica","Libertad"};
		
		List<String[]> lista = new ArrayList<String[]>();
		lista.add(times);
		lista.add(times2);
		
		request.setAttribute("times", times);
		request.setAttribute("lista", lista);
		
		RequestDispatcher requestDispatcher = request.getRequestDispatcher("cap9/pg448/tagCForEach.jsp");
		requestDispatcher.forward(request, response);
		
		
		
		
		

	}

	

}
